from django.conf.urls.defaults import *
from django.conf import settings
from main.models import Snapshot
from feeds import LatestEntries

info_dict = {
    'queryset': Snapshot.objects.all(),
    'date_field': 'snapshot_time',
    'allow_empty': True,
}

feed_dict =  {
    'latest': LatestEntries,
}

generic = 'django.views.generic.date_based.'

urlpatterns = patterns('',
    # behold ye mighty generic views.
    #
    # Note: Currently, the year/month and object detail views are not implemented
    # as there's no major need for them.
    # If you DO want them, then you'll need to add the correct templates to the 
    # "./templates/main" subdir. You should be able to just copy snapshot_archive.html, 
    # and then tweak appropriately
    
    #(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', generic+'object_detail', info_dict),
    #(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', generic+'archive_month', info_dict),
    #(r'^(?P<year>\d{4})/$', generic+'archive_year',  info_dict),
    (r'^/?$', generic+'archive_index', info_dict),

    # feed
    (r'^feed/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feed_dict}),
    
    # Admin section. Not strictly necessary, but it does mean you can edit stuff.
    (r'^admin/', include('django.contrib.admin.urls')),
)
